<template>
  <div style="position: relative;">
    <div class="ht-head-wrap">
      <div class="title-item">
        <router-link to="/ng-overall-view">全景农谷</router-link>
      </div>
      <div class="title-item">
        <router-link to="/sx-famous">三品一标</router-link>
      </div>
      <div class="title-item">
        <router-link to="/sx-digital-greatCause">数字农业</router-link>
      </div>
      <div class="title-item">
        <router-link to="/sx-technology">科技研发</router-link>
      </div>
      <div class="title-item title-item-active">
        <router-link to="/ng-remote-sensing">卫星遥感</router-link>
      </div>
    </div>
    <div class="ht-content clear-float">
      <div class="ng-content-left">
        <ng-rs-left></ng-rs-left>
      </div>
      <div class="content-middle">
        <ng-rs-middle></ng-rs-middle>
      </div>
      <div class="ng-content-right">
        <ng-rs-right></ng-rs-right>
      </div>
    </div>
  </div>
</template>

<script>
  import { mapActions } from "vuex";
  import ngRsLeft from "./ng-rs-left/ng-rs-left";
  import ngRsMiddle from "./ng-rs-middle/ng-rs-middle";
  import ngRsRight from "./ng-rs-right/ng-rs-right";
  export default {
    name: "ng-rs",
    data() {
      return {};
    },
    components: {
      ngRsLeft,
      ngRsMiddle,
      ngRsRight
    },
    mounted() {
      this.getDataboxList();
    },
    methods: {
      ...mapActions(['setRemoteData']),
      async getDataboxList() {
        let _this = this;
        let _param = {
          mark: "010101"
        };
        const {
          status = 0, data = {}
        } = await this.$axios
          .post(this.$api.getDataboxList, this.$qs.stringify(_param), {
            headers: {
              "content-type": " application/x-www-form-urlencoded"
            }
          });
        if(status == 200) {
          let _list = JSON.parse(data.obj).list;
          let _boxNum = {
            adminCode: "140726",
            boxNum: _list.map(item => item.boxnum).join(",")
          }
          const _data = await this.$axios.post(this.$api.getStatisticsList,this.$qs.stringify(_boxNum),{
            headers: {
              "content-type": " application/x-www-form-urlencoded"
            }
          });
          if(_data.status == 200) {
            let _obj = JSON.parse(_data.data.obj).obj;
            this.setRemoteData(_obj);
          }
        }
      }
    }
  };

</script>

<style lang="scss" scoped>
  .content-middle {
    top: 0px !important;
    width: 3072px;
    left: 0;
    padding: 0;
  }

  .ng-content-left {
    position: absolute;
    left: 0;
    z-index: 9;
    width: 530px;
    height: 100%;
    padding: 125px 0 20px 0;
    box-sizing: border-box;
  }

  .ng-content-right {
    position: absolute;
    right: 0;
    z-index: 9;
    width: 530px;
    height: 100%;
    padding: 125px 0 20px 0;
    box-sizing: border-box;
  }

</style>
